import Vue from "vue";
import ElementUI from "element-ui";
import Router from 'vue-router';
import axios from 'axios';
import "element-ui/lib/theme-chalk/index.css";
import * as echarts from 'echarts';

//引入移动端组件
import '@/core/utils/vant-ui'
import 'vant/lib/index.css';
import { Cell, CellGroup, Divider } from 'vant';
import { Image as VanImage } from 'vant';
import { Popup } from 'vant';
import { Toast } from 'vant';
import { Picker } from 'vant';
import { RadioGroup, Radio } from 'vant';
import { Calendar,DatetimePicker } from 'vant';
import { Search } from 'vant';
import { Cascader } from 'vant';
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(VanImage);
Vue.use(Popup);
Vue.use(Toast);
Vue.use(Picker);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Divider);
Vue.use(Calendar);
Vue.use(DatetimePicker);
Vue.use(Search);
Vue.use(Cascader);
//
const  {
    elm,
    ElmRouter,
    elmVueBase,
    ElmPageLr,
    ElmPageTb,
    ElmPageBb,
    Right,
    elmDialog,
    ElmOpenButton,
    ElmDeleteButton,
    ElmSaveButton,
    ElmSelectTree,
    ElmSelect,
    ElmTableTree,
    ElmTable,
    ElmPage,
    ElmRMenu,
    ElmRow,
    ElmTag,
    elmSelectInput,
    elmCkeditor
} = elmVue2;
//

import ElmOrg from "@/core/utils/syscontrol/elm-org.vue";
import ElmUser from "@/core/utils/syscontrol/elm-user.vue";
import ElmEI from "@/core/utils/syscontrol/elm-ei.vue";
import ElmCode from "@/core/utils/syscontrol/elm-code.vue";
import elmUpload from "@/core/utils/syscontrol/elm-upload.vue";
import elmFileView from "@/core/utils/syscontrol/elm-fileview.vue";
import ElmContract from "@/core/utils/syscontrol/elm-contract.vue";
import ElmOrder from "@/core/utils/syscontrol/elm-order.vue";
import ElmCostType from "@/core/utils/syscontrol/elm-cost-type.vue";
import ElmProject from "@/core/utils/syscontrol/elm-project.vue";
import ElmMyCustomer from "@/core/utils/syscontrol/elm-my-customer.vue";
import ElmFlowSubmitButton from "@/core/utils/syscontrol/elm-flow-submit-button.vue";
import ElmFlowPushBackButton from "@/core/utils/syscontrol/elm-flow-pushback-button.vue";
import ElmFlowPushBackInfo from "@/core/utils/syscontrol/elm-flow-pushback-info.vue";
import ElmFlowSecform from "@/core/utils/syscontrol/elm-flow-secform.vue";
import ElmFlowHistory from "@/core/utils/syscontrol/elm-flow-history.vue";
import ElmFlowSecformDataDeleteButton from "@/core/utils/syscontrol/elm-flow-secformdata-delete-button.vue";
import ElmFlowCanvasShow from "@/core/utils/syscontrol/elm-flow-canvas-show.vue";
import ElmCar from "@/core/utils/syscontrol/elm-car.vue";
import ElmCus from "@/core/utils/syscontrol/elm-cus.vue";
import ElmGoods from "@/core/utils/syscontrol/elm-goods.vue";
import ElmGoodsType from "@/core/utils/syscontrol/elm-goods-type.vue";
import ElmFileShow from "@/core/utils/syscontrol/elm-file-show.vue";

//手机端组件
import ElmMobTaskRwzp from "@/core/utils/syscontrol/elm-mob-task-rwzp.vue";
import ElmMobFlowSecform from "@/core/utils/syscontrol/elm-mob-flow-secform.vue";
import ElmMobNewPage from "@/core/utils/syscontrol/elm-mob-new-page.vue";
import ElmMobEi from "@/core/utils/syscontrol/elm-mob-ei.vue";
import ElmMobOrg from "@/core/utils/syscontrol/elm-mob-org.vue";
import ElmMobCar from "@/core/utils/syscontrol/elm-mob-car.vue";
import ElmMobCostType from "@/core/utils/syscontrol/elm-mob-cost-type.vue";
import ElmMobCode from "@/core/utils/syscontrol/elm-mob-code.vue";
import ElmMobSelect from "@/core/utils/control/elm-mob-select.vue";
import ElmMobMainPC from "@/mob/system/elm-mob-main-pc.vue";
import ElmMobMainMobile from "@/mob/system/elm-mob-main-mobile.vue";
import ElmFileshow from "@/core/utils/syscontrol/elm-file-show.vue";


// 全局方法挂载
Vue.prototype.$echarts = echarts

// 全局组件挂载
Vue.component("elm-page-lr", ElmPageLr);
Vue.component("elm-page-tb", ElmPageTb);
Vue.component("elm-page-bb", ElmPageBb);
Vue.component("right", Right);
//
Vue.component("elm-dialog", elmDialog);
Vue.component("elm-open-button", ElmOpenButton);
Vue.component("elm-delete-button", ElmDeleteButton);
Vue.component("elm-save-button", ElmSaveButton);
Vue.component("elm-select-tree", ElmSelectTree);
Vue.component("elm-select", ElmSelect);
Vue.component("elm-table-tree", ElmTableTree);
Vue.component("elm-table", ElmTable);
Vue.component("elm-page", ElmPage);
Vue.component("elm-rmenu", ElmRMenu);
Vue.component("elm-row", ElmRow);
Vue.component("elm-tag", ElmTag);
Vue.component("elm-select-input", elmSelectInput);
Vue.component("elm-ckeditor", elmCkeditor);
//
Vue.component("elm-org", ElmOrg);
Vue.component("elm-user", ElmUser);
Vue.component("elm-ei", ElmEI);
Vue.component("elm-code", ElmCode);
Vue.component("elm-upload", elmUpload);
Vue.component("elm-fileview", elmFileView);
Vue.component("elm-contract", ElmContract);
Vue.component("elm-order", ElmOrder);
Vue.component("elm-cost-type", ElmCostType);
Vue.component("elm-project", ElmProject);
Vue.component("elm-my-customer", ElmMyCustomer);
//
Vue.component("elm-flow-submit-button", ElmFlowSubmitButton);
Vue.component("elm-flow-pushback-button", ElmFlowPushBackButton);
Vue.component("elm-flow-pushback-info", ElmFlowPushBackInfo);
Vue.component("elm-flow-secform", ElmFlowSecform);
Vue.component("elm-flow-history", ElmFlowHistory);
Vue.component("elm-flow-secformdata-delete-button", ElmFlowSecformDataDeleteButton);
Vue.component("elm-flow-canvas-show", ElmFlowCanvasShow);
//
Vue.component("elm-car", ElmCar);
Vue.component("elm-cus", ElmCus);
Vue.component("elm-goods", ElmGoods);
Vue.component("elm-goods-type", ElmGoodsType);
Vue.component("elm-file-show", ElmFileShow);
//
Vue.component("elm-mob-task-rwzp", ElmMobTaskRwzp);
Vue.component("elm-mob-flow-secform", ElmMobFlowSecform);
Vue.component("elm-mob-new-page", ElmMobNewPage);
Vue.component("elm-mob-ei", ElmMobEi);
Vue.component("elm-mob-org", ElmMobOrg);
Vue.component("elm-mob-car", ElmMobCar);
Vue.component("elm-mob-cost-type", ElmMobCostType);
Vue.component("elm-mob-code", ElmMobCode);
Vue.component("elm-mob-select", ElmMobSelect);
Vue.component("elm-mob-main-pc", ElmMobMainPC);
Vue.component("elm-mob-main-mobile", ElmMobMainMobile);

window.elm = elm;
window.elmVueBase = elmVueBase;
window.elm.ElmRouter = ElmRouter;
elm.modules = import.meta.glob("../**/**/**.vue");
var router = ElmRouter(Vue,Router)

Vue.config.productionTip = true;
Vue.use(ElementUI);
Vue.prototype.$axios = axios;
window.dateTostr = function DateToStr(date) {
    var year = date.getFullYear(); // 年
    var month = date.getMonth() + 1; // 月
    var day = date.getDate(); // 日
// 添加前导零
    month = month < 10 ? '0' + month : month;
    day = day < 10 ? '0' + day : day;
    return year + '-' + month + '-' + day;
}


export default router;